org.eclipse.vtp.desktop.projects.core.internals
Class DatabaseTable

java.lang.Object
  extended by org.eclipse.vtp.desktop.projects.core.internals.VoiceResource
      extended by org.eclipse.vtp.desktop.projects.core.internals.DatabaseTable
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, IDatabaseTable, ObjectListener, IVoiceToolsResource

public class DatabaseTable
extends VoiceResource
implements IDatabaseTable

This is a concrete implementation of IDatabaseTable and provides the default behavior of that interface.

Version:
2.0
Author:
Trip Gilman

Constructor Summary
DatabaseTable(Database database, org.eclipse.core.resources.IFile file)
          Creates a new DatabaseTable with the given parent database and eclipse file resource.
 
Method Summary
 void delete()
           
 boolean equals(java.lang.Object obj)
           
 java.util.List getColumns()
           
 java.lang.String getName()
           
protected  java.lang.String getObjectId()
          The object id is used by the event system to uniquely identify a project resource.
 IVoiceToolsResource getParent()
          Returns the parent of this resource.
 org.eclipse.core.resources.IFile getUnderlyingFile()
           
 void processObjectEvent(ObjectEvent event)
          Called when an event is generated by the object being listened to.
 void write(java.io.InputStream source)
          Requests that the contents of the column definition resource be replace with the data provided by the given input stream.
 
Methods inherited from class org.eclipse.vtp.desktop.projects.core.internals.VoiceResource
addRefreshListener, deferEvents, finalize, getAdapter, getProject, refresh, removeRefreshListener, resumeEvents
 
Methods inherited from class java.lang.Object
clone, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseTable

public DatabaseTable(Database database,
                     org.eclipse.core.resources.IFile file)
Creates a new DatabaseTable with the given parent database and eclipse file resource.

Parameters:
database - The parent database
file - The eclipse file resource that contains the definition of table columns
Method Detail

getObjectId

protected java.lang.String getObjectId()
Description copied from class: VoiceResource
The object id is used by the event system to uniquely identify a project resource. In this fashion, multiple references to the resource can be created and still be notified of events.

Specified by:
getObjectId in class VoiceResource
Returns:
A unique identifier for this resource

getName

public java.lang.String getName()
Specified by:
getName in interface IDatabaseTable
Specified by:
getName in interface IVoiceToolsResource
Returns:
The name of this database table

getColumns

public java.util.List getColumns()
Specified by:
getColumns in interface IDatabaseTable
Returns:
The list of IDatabaseTableColumns defined for this database table

getParent

public IVoiceToolsResource getParent()
Description copied from interface: IVoiceToolsResource
Returns the parent of this resource. If this is a project resource this function returns this.

Specified by:
getParent in interface IVoiceToolsResource
Returns:
The parent of this resource resource

write

public void write(java.io.InputStream source)
           throws org.eclipse.core.runtime.CoreException
Requests that the contents of the column definition resource be replace with the data provided by the given input stream.

Parameters:
source - The input stream containing the new contents.
Throws:
org.eclipse.core.runtime.CoreException - If an error occured during the file update

processObjectEvent

public void processObjectEvent(ObjectEvent event)
Description copied from interface: ObjectListener
Called when an event is generated by the object being listened to.

Specified by:
processObjectEvent in interface ObjectListener
Overrides:
processObjectEvent in class VoiceResource
Parameters:
event - The event that occured

delete

public void delete()
            throws org.eclipse.core.runtime.CoreException
Specified by:
delete in interface IDatabaseTable
Throws:
org.eclipse.core.runtime.CoreException

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getUnderlyingFile

public org.eclipse.core.resources.IFile getUnderlyingFile()
Specified by:
getUnderlyingFile in interface IDatabaseTable